package 作业.Var1029.Test1;

//飞行接口
public class Flights {
    String puru;

    public Flights(String puru) {
        this.puru = puru;
    }

    public Flights() {
    }

    public String getPuru() {
        return puru;
    }

    public void setPuru(String puru) {
        this.puru = puru;
    }

    private Flight flight;


    public Flight getFlight() {
        return flight;
    }

    public void setFlight(Flight flight) {
        this.flight = flight;
    }

    //鸟
    public void niao() {
        System.out.println(flight.getflight() + "会飞");
    }

    //飞机
    public void feiji() {
        System.out.println(flight.getflight() + "也会飞，但它们不是哺乳动物也不是鸟类");
    }

    //蝙蝠
    public void print() {
        System.out.println("哺乳动物中只有" + flight.getflight() + "会飞");
    }
}
